local que_yushi = fk.CreateSkill {
  name = "que_yushi",
  anim_type = "defensive",
}
Fk:loadTranslationTable {
  ["que_yushi"] = "羽释",
  [":que_yushi"] = "出牌阶段限一次，你可以失去任意体力值，获得等量+1点护甲，若你至少拥有一枚“薪火”，你移去所有薪火，摸等量的牌；若你拥有护甲，结束阶段你摸一张牌。",
  ["#que_yushi"] = "羽释：你可以失去至多%arg点体力，获得等量+1点护甲并移去所有薪火。",
}
que_yushi:addEffect("active", {
  name = "que_yushi",
  anim_type = "drawcard",
  card_num = 0,
  target_num = 0,
  interaction = function(self, player)
    return UI.Spin {
      from = 1,
      to = player.hp,
    }
  end,
  prompt = function(self, player)
    return "#que_yushi:::" .. player.hp
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(que_yushi.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local n = self.interaction.data
    room:loseHp(player, n, que_yushi.name)
    room:changeShield(player, 1 + n)
    if player:getMark("@bmw_xinhuo") > 0 then
      player:drawCards(player:getMark("@bmw_xinhuo"), que_yushi.name)
      room:setPlayerMark(player, "@bmw_xinhuo", 0)
    end
  end,
})

que_yushi:addEffect(fk.TurnEnd, {
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(que_yushi.name) and target == player and player.shield > 0
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, que_yushi.name)
  end,
})
return que_yushi
